package com.wxq.blog.handle;

import com.wxq.blog.vo.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

//对加入controller注释的方法进行AOP拦截
@ControllerAdvice
public class AllExceptionHandle {
    //    进行异常处理
    @ExceptionHandler(Exception.class)
    public Result daException(Exception exception) {
        exception.printStackTrace();
        return Result.fail(-999,"系统异常");
    }
}
